import request from '@/utils/request'

// 查询电池列表
export function listBattery(query) {
  return request({
    url: '/healthy/battery/list',
    method: 'get',
    params: query
  })
}

// 获取在线电池
export function getOnlineBattery(query) {
  return request({
    url: '/healthy/battery/online',
    method: 'get',
    params: query
  })
}

// 获取告警电池
export function getAlarmBattery() {
  return request({
    url: '/healthy/battery/alarm',
    method: 'get'
  })
}

// 获取电池统计数据
export function getBatteryStats() {
  return request({
    url: '/healthy/battery/stats',
    method: 'get'
  })
}

// 报废电池
export function scrapBattery(id) {
  return request({
    url: `/healthy/battery/scrap/${id}`,
    method: 'put'
  })
}